package cyou.breathe.blog.base.response;

import cyou.breathe.blog.base.exception.ErrorCode;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

import java.io.Serializable;

/**
 * @author: breathe
 * @createTime: 2025-08-26
 */
@Setter
@Getter
@ToString
public class BaseResponse implements Serializable {
    private static final long serialVersionUID = 1L;

    private Boolean success;

    private String responseCode;

    private String responseMessage;

    private ErrorCode errorCode;

    public void setErrorCode(ErrorCode errorCode) {
        this.success = false;
        this.errorCode = errorCode;
        this.responseCode = errorCode.getCode();
        this.responseMessage = errorCode.getMessage();
    }
}
